package com.boang.fx;

import java.util.ArrayList;
import java.util.Iterator;

/*
  @author: 13813
  @date: 2024/11/28 16:15
*/
public class ArrayListDemo01 {
    public static void main(String[] args) {
        ArrayList<String> arrayList = new ArrayList<String>();
        arrayList.add("a");
//        arrayList.add(1); //new Integer(1);

        Iterator<String> iterator = arrayList.iterator();

        while (iterator.hasNext()) {
//            String str = (String) iterator.next();  //ClassCastException 类型转换错误
            String str = iterator.next();
            System.out.println(str);
        }
    }
}
